#include "pch.hpp"
#include "Desktop.hpp"

using namespace Engine;
using namespace Engine::Ui;




Desktop::Desktop(int2 pos, intsize2 size, BasicStyleDefinition::ptr style)
	// We are the only window without a parent
	: Widget(style)
	//, m_console(new Console(this, Widgets::Console))
{
	//m_console->setVisible(false);

	// Add the shell to the children
	//add(m_console);

	// We need to watch ourselves being resized
	resized.connect(boost::bind(&Desktop::onResized, this));

	// We set the requested position and size
	setPos(pos);
	resize(size);
}
///////////////////////////////////////////////////////////////////////////////////////////////////




/*
ConsolePtr Desktop::console() const
{
	return m_console;
}
///////////////////////////////////////////////////////////////////////////////////////////////////
*/




Widgets::Type Desktop::type() const
{
	return Widgets::Desktop;
}
///////////////////////////////////////////////////////////////////////////////////////////////////




void Desktop::onResized()
{
	intsize2 csize = clientSize();
	csize.height /= 2;

	// The shell stays on the upper half of the screen, taking
	// all the width and half of the height of the screen.
	//m_console->resize(csize);
}
///////////////////////////////////////////////////////////////////////////////////////////////////
